<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
// Route::get('toauth', 'Api\AuthController@toauth');
Route::group(['namespace' => 'Api',], function () {
    Route::get('login-url', 'AuthController@getLoginUrl');
    Route::post('login', 'AuthController@login');
    Route::post('logout', 'AuthController@logout');
    Route::post('refresh', 'AuthController@refresh');
    Route::group(['middleware' => 'jwt.auth',], function () {

        Route::group(['prefix' => 'job'], function () {
            Route::post('','JobController@create');
            Route::post('/{id}','JobController@update');
            Route::get('','JobController@list');
            Route::get('/{id}','JobController@find');
            Route::delete('/{id}','JobController@delete');
        });
        Route::get('authed', function () {
            return 'authed';
        });

    });
    // Route::get('noauth', function () {
    //     return 'noauth';
    // });
});